package cn.dengta.webapp.user.entity;

import java.util.Date;

import cn.dengta.common.model.State;
import cn.dengta.common.model.Status;
import cn.dengta.context.model.Language;
import cn.dengta.webapp.base.entity.BizEntity;
import cn.dengta.webapp.user.model.PlanetExploreType;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 星球探险日志
 *
 * @author lgy
 * @since 2022-10-13
 */
@Setter
@Getter
@Accessors(chain = true)
@TableName("act_planet_explore_buy_log")
public class ActPlanetExploreBuyLog extends BizEntity {

	/** 用户ID */
	Long userId;
	/** 星球探险ID */
	Long actPlanetExploreId;
	/** 购买星球 */
	Integer planet;
	/** 星球名称 */
	String name;
	/** 押注数 */
	Integer betCount;
	/** 钻石数 */
	Integer coin;
	/** 中奖钻石数 */
	Integer prizeCoin;

	public ActPlanetExploreBuyLog init(Long userId, Long actPlanetExploreId, PlanetExploreType planet, Integer betCount, Integer coin, Date now) {
		this.userId = userId;
		this.actPlanetExploreId = actPlanetExploreId;
		this.planet = planet.value;
		this.name = planet.defaultLabel();
		this.betCount = betCount;
		this.coin = coin;
		this.prizeCoin = 0;
		super.init(Status.NO.value, State.PUBLIC);
		super.initTime(now);
		return this;
	}

	public static final String USER_ID = "user_id";
	public static final String ACT_PLANET_EXPLORE_ID = "act_planet_explore_id";
	public static final String PLANET = "planet";
	public static final String NAME = "name";
	public static final String BET_COUNT = "bet_count";
	public static final String COIN = "coin";
	public static final String PRIZE_COIN = "prize_coin";

}
